package com.guoxue.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.guoxue.dao.IOrderDao;
import com.guoxue.dao.IPushDao;
import com.guoxue.domain.PushVo;
@Repository
public class PushDaoImpl extends BaseDaoImpl<PushVo> implements IPushDao{

	@Override
	public void savePush(PushVo push) {
		saveOrUpdate(push);
	}

	@Override
	public List<PushVo> getPushList() {
		return find("FROM PushVo p");
	}

	@Override
	public PushVo getPush(int id) {
		return get("FROM PushVo p WHERE p.id = ?", new Object[]{id});
	}

	@Override
	public void deletePush(Integer id) {
		executeHql("DELETE FROM PushVo p WHERE p.id=?", new Object[] {id});
	}

	@Override
	public List<PushVo> getLastPushList() {
		return find("FROM PushVo p WHERE p.sysflag = 1 ORDER BY p.createTime DESC");
	}

}
